<html>
<head><meta charset="utf-8"><title>meeting 2021-05-11 · project-const-generics · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/index.html">project-const-generics</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html">meeting 2021-05-11</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="238274730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238274730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238274730">(May 11 2021 at 09:05)</a>:</h4>
<p>Meeting here in more than 5 hours</p>



<a name="238274816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238274816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238274816">(May 11 2021 at 09:06)</a>:</h4>
<p>probably continuing working on the vision doc</p>



<a name="238319993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238319993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238319993">(May 11 2021 at 14:46)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="3805">@project-const-generics</span> you absolute legends, it's meeting time</p>



<a name="238320069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238320069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238320069">(May 11 2021 at 14:46)</a>:</h4>
<p>wip vision doc from last week: <a href="https://hackmd.io/VOaGjRYsSXW4PR_VNwQmSQ">https://hackmd.io/VOaGjRYsSXW4PR_VNwQmSQ</a></p>



<a name="238320515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238320515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238320515">(May 11 2021 at 14:49)</a>:</h4>
<p>wave</p>



<a name="238320538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238320538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238320538">(May 11 2021 at 14:49)</a>:</h4>
<p>how are things</p>



<a name="238320702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238320702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238320702">(May 11 2021 at 14:50)</a>:</h4>
<p>one handed typing, but present</p>



<a name="238320722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238320722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238320722">(May 11 2021 at 14:50)</a>:</h4>
<p>^ same</p>



<a name="238320755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238320755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238320755">(May 11 2021 at 14:50)</a>:</h4>
<p>hmm, there's been some threads since last week :)</p>



<a name="238320878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238320878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238320878">(May 11 2021 at 14:51)</a>:</h4>
<p>we were talking about xamprocky's case</p>



<a name="238320911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238320911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238320911">(May 11 2021 at 14:51)</a>:</h4>
<p>I imagine <span class="user-mention" data-user-id="216206">@lcnr</span> that for "const evaluatable checked' we would eventually want to be able to do</p>



<a name="238321026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321026">(May 11 2021 at 14:52)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">A</span>: <span class="kt">usize</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">B</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;</span><span class="n">A</span><span class="p">,</span><span class="w"> </span><span class="n">B</span><span class="o">&gt;</span><span class="w"></span>
<span class="w">    </span><span class="k">where</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">condition</span><span class="p">(</span><span class="n">A</span><span class="p">,</span><span class="w"> </span><span class="n">B</span><span class="p">)</span><span class="w"> </span><span class="p">},</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">foo</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="238321029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321029">(May 11 2021 at 14:52)</a>:</h4>
<p>or something like that?</p>



<a name="238321053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321053">(May 11 2021 at 14:52)</a>:</h4>
<p>yes</p>



<a name="238321115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321115">(May 11 2021 at 14:52)</a>:</h4>
<p>let's note that down</p>



<a name="238321134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321134">(May 11 2021 at 14:53)</a>:</h4>
<p>I feel like we spent a while talking about safety, didn't we?</p>



<a name="238321187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321187">(May 11 2021 at 14:53)</a>:</h4>
<blockquote>
<p>safety</p>
</blockquote>
<p>in which context?</p>



<a name="238321295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321295">(May 11 2021 at 14:54)</a>:</h4>
<p>like, what does it mean to write a "safe const fn"</p>



<a name="238321299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321299">(May 11 2021 at 14:54)</a>:</h4>
<p>or an "unsafe const fn'</p>



<a name="238321332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321332">(May 11 2021 at 14:54)</a>:</h4>
<p>and in particular the idea that there are some operations that are not safe in const fns</p>



<a name="238321338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321338">(May 11 2021 at 14:54)</a>:</h4>
<p>which are safe in regular code</p>



<a name="238321351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321351">(May 11 2021 at 14:54)</a>:</h4>
<p>(becauset they may not be constant)</p>



<a name="238321496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321496">(May 11 2021 at 14:55)</a>:</h4>
<p>that was something we did talk about, yeah</p>



<a name="238321519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321519">(May 11 2021 at 14:55)</a>:</h4>
<p>what's an example of something that's not safe in const again?</p>



<a name="238321531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321531">(May 11 2021 at 14:55)</a>:</h4>
<p>I guess casting pointers to integers</p>



<a name="238321666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321666">(May 11 2021 at 14:56)</a>:</h4>
<p>i think that const safety is more the responsibility of <span class="user-group-mention" data-user-group-id="1916">@WG-const-eval</span> than project const generics</p>



<a name="238321719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321719">(May 11 2021 at 14:57)</a>:</h4>
<p>for const generics we don't have to care about any of that as long as our const arguments are deterministic</p>



<a name="238321838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321838">(May 11 2021 at 14:57)</a>:</h4>
<p>there is a fairly big overlap between those two wgs and const-eval doesn't have regular meetings</p>



<a name="238321894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321894">(May 11 2021 at 14:58)</a>:</h4>
<p>so it may still make sense to talk about this here</p>



<a name="238321956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238321956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238321956">(May 11 2021 at 14:58)</a>:</h4>
<p>but i want <span class="user-mention silent" data-user-id="120791">RalfJ</span> to be there whenever we talk about that</p>



<a name="238322139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322139">(May 11 2021 at 14:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238321666">said</a>:</p>
<blockquote>
<p>i think that const safety is more the responsibility of <span class="user-group-mention" data-user-group-id="1916">@WG-const-eval</span> than project const generics</p>
</blockquote>
<p>That makes senes; I'm not sure though if those things are distinct enough to separate for our purposes.</p>



<a name="238322228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322228">(May 11 2021 at 15:00)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238321956">said</a>:</p>
<blockquote>
<p>but i want <span class="user-mention silent" data-user-id="120791">RalfJ</span> to be there whenever we talk about that</p>
</blockquote>
<p>I think a better approach than expecting everyone to be present is to get feedback from them</p>



<a name="238322252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322252">(May 11 2021 at 15:00)</a>:</h4>
<p>(i mean it's great if they <em>are</em>...)</p>



<a name="238322348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322348">(May 11 2021 at 15:00)</a>:</h4>
<p>so I wrote this example</p>



<a name="238322359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322359">(May 11 2021 at 15:00)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="w"></span>
<span class="w">        </span><span class="n">SampledType</span>: <span class="nc">SampleType</span><span class="o">&lt;</span><span class="n">FORMAT</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">DIM</span>: <span class="nc">Dimensionality</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">DEPTH</span>: <span class="nc">ImageDepth</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">ARRAYED</span>: <span class="nc">Arrayed</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">MULTISAMPLED</span>: <span class="nc">Multisampled</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">SAMPLED</span>: <span class="nc">Sampled</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">FORMAT</span>: <span class="nc">ImageFormat</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">ACCESS_QUALIFIER</span>: <span class="nb">Option</span><span class="o">&lt;</span><span class="n">AccessQualifier</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="o">&gt;</span><span class="w"> </span><span class="n">Image</span><span class="o">&lt;</span><span class="n">SampledType</span><span class="p">,</span><span class="w"> </span><span class="n">DIM</span><span class="p">,</span><span class="w"> </span><span class="n">DEPTH</span><span class="p">,</span><span class="w"> </span><span class="n">ARRAYED</span><span class="p">,</span><span class="w"> </span><span class="n">MULTISAMPLED</span><span class="p">,</span><span class="w"> </span><span class="n">SAMPLED</span><span class="p">,</span><span class="w"> </span><span class="n">FORMAT</span><span class="p">,</span><span class="w"> </span><span class="n">ACCESS_QUALIFIER</span><span class="o">&gt;</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">query_size_lod</span><span class="o">&lt;</span><span class="n">Size</span>: <span class="nc">ImageCoordinate</span><span class="o">&lt;</span><span class="kt">u32</span><span class="p">,</span><span class="w"> </span><span class="n">DIM</span><span class="p">,</span><span class="w"> </span><span class="n">ARRAYED</span><span class="o">&gt;</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nb">Default</span><span class="o">&gt;</span><span class="p">(</span><span class="o">..</span><span class="p">.)</span><span class="w"></span>
<span class="w">    </span><span class="k">where</span><span class="w"></span>
<span class="w">        </span><span class="p">{</span><span class="w"> </span><span class="n">MULTISAMPLED</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">Multisampled</span>::<span class="n">False</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="238322408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322408">(May 11 2021 at 15:01)</a>:</h4>
<p>I'm not 100% sure that is feasible or all that shiny though :)</p>



<a name="238322430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322430">(May 11 2021 at 15:01)</a>:</h4>
<p>arbitrary equality constraints are kind of ... complex</p>



<a name="238322529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322529">(May 11 2021 at 15:01)</a>:</h4>
<p>I do think supporting const fns as boolean conditions is good though</p>



<a name="238322718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322718">(May 11 2021 at 15:02)</a>:</h4>
<p>right now these const bounds are only enforced to be correct. Are we talking about actually having booleans from CTFE feed back into the type system and make decisions there?</p>



<a name="238322754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322754">(May 11 2021 at 15:02)</a>:</h4>
<p>I'm not :)</p>



<a name="238322762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322762">(May 11 2021 at 15:02)</a>:</h4>
<p>which is why I'm rewriting the example a bit</p>



<a name="238322879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322879">(May 11 2021 at 15:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238322718">said</a>:</p>
<blockquote>
<p>right now these const bounds are only enforced to be correct. Are we talking about actually having booleans from CTFE feed back into the type system and make decisions there?</p>
</blockquote>
<p><span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span>  current const evaluatable bounds assert evaluatability, without really caring about the return type</p>



<a name="238322897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322897">(May 11 2021 at 15:03)</a>:</h4>
<p>hmm but we can already kind of do this though right?</p>



<a name="238322919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322919">(May 11 2021 at 15:03)</a>:</h4>
<p>it's jsut less ergonomic because you have to panic if its false</p>



<a name="238322932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322932">(May 11 2021 at 15:03)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="w"></span>
<span class="w">        </span><span class="n">SampledType</span>: <span class="nc">SampleType</span><span class="o">&lt;</span><span class="n">FORMAT</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">DIM</span>: <span class="nc">Dimensionality</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">DEPTH</span>: <span class="nc">ImageDepth</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">ARRAYED</span>: <span class="nc">Arrayed</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">MULTISAMPLED</span>: <span class="nc">Multisampled</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">SAMPLED</span>: <span class="nc">Sampled</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">FORMAT</span>: <span class="nc">ImageFormat</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">ACCESS_QUALIFIER</span>: <span class="nb">Option</span><span class="o">&lt;</span><span class="n">AccessQualifier</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="o">&gt;</span><span class="w"> </span><span class="n">Image</span><span class="o">&lt;</span><span class="n">SampledType</span><span class="p">,</span><span class="w"> </span><span class="n">DIM</span><span class="p">,</span><span class="w"> </span><span class="n">DEPTH</span><span class="p">,</span><span class="w"> </span><span class="n">ARRAYED</span><span class="p">,</span><span class="w"> </span><span class="n">MULTISAMPLED</span><span class="p">,</span><span class="w"> </span><span class="n">SAMPLED</span><span class="p">,</span><span class="w"> </span><span class="n">FORMAT</span><span class="p">,</span><span class="w"> </span><span class="n">ACCESS_QUALIFIER</span><span class="o">&gt;</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">example_method</span><span class="p">(</span><span class="o">..</span><span class="p">.)</span><span class="w"></span>
<span class="w">    </span><span class="k">where</span><span class="w"></span>
<span class="w">        </span><span class="p">{</span><span class="w"> </span><span class="n">some_condition</span><span class="p">(</span><span class="n">DEPTH</span><span class="p">,</span><span class="w"> </span><span class="n">MULTISAMPLED</span><span class="p">)</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">ImageDepth</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">value</span>: <span class="kt">u32</span> <span class="p">}</span><span class="w"></span>

<span class="k">enum</span> <span class="nc">Multisampled</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">True</span><span class="p">,</span><span class="w"> </span><span class="n">False</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">some_condition</span><span class="p">(</span><span class="n">a</span>: <span class="nc">ImageDepth</span><span class="p">,</span><span class="w"> </span><span class="n">m</span>: <span class="nc">Multisampled</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kt">bool</span> <span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">match</span><span class="w"> </span><span class="p">(</span><span class="n">a</span><span class="p">,</span><span class="w"> </span><span class="n">m</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="o">..</span><span class="p">.</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="238322939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322939">(May 11 2021 at 15:03)</a>:</h4>
<p>boolean conditions would have to be written something like <code>evaluatable { assert!(cond) }</code></p>



<a name="238322940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322940">(May 11 2021 at 15:03)</a>:</h4>
<p>something like that</p>



<a name="238322989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322989">(May 11 2021 at 15:03)</a>:</h4>
<p>yeah, so evaluatable is part of what led us here :)</p>



<a name="238322998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238322998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238322998">(May 11 2021 at 15:04)</a>:</h4>
<p>let's dig a bit into that</p>



<a name="238323246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323246">(May 11 2021 at 15:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238322718">said</a>:</p>
<blockquote>
<p>right now these const bounds are only enforced to be correct. Are we talking about actually having booleans from CTFE feed back into the type system and make decisions there?</p>
</blockquote>
<p>well, I don't know what "be correct" means</p>



<a name="238323299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323299">(May 11 2021 at 15:05)</a>:</h4>
<p>but I would definitely expect you to be able to say "this evaluates to true" as a where clause</p>



<a name="238323311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323311">(May 11 2021 at 15:05)</a>:</h4>
<p>it's hard to see why you...wouldn't :)</p>



<a name="238323425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323425">(May 11 2021 at 15:05)</a>:</h4>
<p>like, you can trivially model it, right? so why not just expose it</p>



<a name="238323443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323443">(May 11 2021 at 15:06)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238323246">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238322718">said</a>:</p>
<blockquote>
<p>right now these const bounds are only enforced to be correct. Are we talking about actually having booleans from CTFE feed back into the type system and make decisions there?</p>
</blockquote>
<p>well, I don't know what "be correct" means</p>
</blockquote>
<p>well, no CTFE error, so also no panic. Right now just having a bool expression will do nothing, you need to assert! to check that it is true</p>



<a name="238323547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323547">(May 11 2021 at 15:06)</a>:</h4>
<p>I shoul add that i still don't believe in evaluatable as a concept, so maybe we can write out the story where I am happy it exists</p>



<a name="238323549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323549">(May 11 2021 at 15:06)</a>:</h4>
<p>but yea, it may be more convenient to go with directly allowing bool expressions (unless we want these to have different meaning in the future)</p>



<a name="238323598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323598">(May 11 2021 at 15:06)</a>:</h4>
<p>I definitely think there should be <em>some</em> way to assert it is true</p>



<a name="238323610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323610">(May 11 2021 at 15:06)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238323299">said</a>:</p>
<blockquote>
<p>but I would definitely expect you to be able to say "this evaluates to true" as a where clause</p>
</blockquote>
<p>yes, rn this can be done using a hack like</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">struct</span> <span class="nc">Condition</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">bool</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">IsTrue</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="w"> </span><span class="n">IsTrue</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Condition</span><span class="o">&lt;</span><span class="kc">true</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>

<span class="c1">// ....</span>
<span class="k">where</span><span class="w"> </span><span class="n">Condition</span><span class="o">&lt;</span><span class="p">{</span><span class="w"> </span><span class="n">expr</span><span class="w"> </span><span class="p">}</span><span class="o">&gt;</span>: <span class="nc">IsTrue</span><span class="w"></span>
</code></pre></div>



<a name="238323653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323653">(May 11 2021 at 15:06)</a>:</h4>
<p>right. I'd just make that a thing.</p>



<a name="238323804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323804">(May 11 2021 at 15:07)</a>:</h4>
<p>what I didn't necessarily want -- or at least we'd have to think on it =) -- is being able to write <code>where { F == 32 }</code> and have that equality kind of "propagate"</p>



<a name="238323806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323806">(May 11 2021 at 15:07)</a>:</h4>
<p>although it would be nice</p>



<a name="238323862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323862">(May 11 2021 at 15:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238323547">said</a>:</p>
<blockquote>
<p>I shoul add that i still don't believe in evaluatable as a concept, so maybe we can write out the story where I am happy it exists</p>
</blockquote>
<p>the "require bounds for all consts" part of it, or is the space you dislike broader?</p>



<a name="238323868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323868">(May 11 2021 at 15:08)</a>:</h4>
<p>in the same way it'd be nice to be able to write </p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="nb">Vec</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">method</span><span class="p">()</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kt">u32</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="o">..</span><span class="p">.</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="238323915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238323915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238323915">(May 11 2021 at 15:08)</a>:</h4>
<p>I just think it's not something that users will understand</p>



<a name="238324004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238324004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238324004">(May 11 2021 at 15:09)</a>:</h4>
<p>it feels like complexity 'leaking out' and I'm not convinced it should</p>



<a name="238324061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238324061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238324061">(May 11 2021 at 15:09)</a>:</h4>
<p>(I realize though that ignoring it will mean errors in later phases)</p>



<a name="238324080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238324080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238324080">(May 11 2021 at 15:09)</a>:</h4>
<p>I'm happy to write both stories to start</p>



<a name="238324116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238324116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238324116">(May 11 2021 at 15:09)</a>:</h4>
<p>let me try I guess</p>



<a name="238324150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238324150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238324150">(May 11 2021 at 15:09)</a>:</h4>
<p>I'm typing at the end of <a href="https://hackmd.io/VOaGjRYsSXW4PR_VNwQmSQ">this hackmd</a></p>



<a name="238324467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238324467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238324467">(May 11 2021 at 15:11)</a>:</h4>
<p>wait, what I was writing doesn't make sense</p>



<a name="238324639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238324639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238324639">(May 11 2021 at 15:12)</a>:</h4>
<p>I think we discussed this in</p>



<a name="238324663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238324663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238324663">(May 11 2021 at 15:12)</a>:</h4>
<p><a class="stream-topic" data-stream-id="260443" href="/#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20">#project-const-generics &gt; meeting 2021-04-20</a></p>



<a name="238324673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238324673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238324673">(May 11 2021 at 15:12)</a>:</h4>
<p>so I'm re-reading</p>



<a name="238324985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238324985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238324985">(May 11 2021 at 15:14)</a>:</h4>
<p>ok, so the example we gave them was <code>split_first</code></p>



<a name="238325003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325003">(May 11 2021 at 15:15)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">split_first</span><span class="o">&lt;</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">(</span><span class="n">arr</span>: <span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="p">])</span><span class="w"> </span>-&gt; <span class="p">(</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">])</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="c1">// ...</span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">tail</span>: <span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="c1">// ...</span>
<span class="w">    </span><span class="p">(</span><span class="n">head</span><span class="p">,</span><span class="w"> </span><span class="n">tail</span><span class="p">)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="238325025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325025">(May 11 2021 at 15:15)</a>:</h4>
<p>this is an interesting one because it intercepts implied bounds</p>



<a name="238325385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325385">(May 11 2021 at 15:17)</a>:</h4>
<p>ok, I think i am starting to see also some of the previous point</p>



<a name="238325411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325411">(May 11 2021 at 15:17)</a>:</h4>
<p>so is the idea that <code>where { &lt;expr&gt; }</code> means "<code>expr</code> can be evaluated without panic"?</p>



<a name="238325497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325497">(May 11 2021 at 15:18)</a>:</h4>
<p>with an open question regarding syntax, yeah</p>



<a name="238325525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325525">(May 11 2021 at 15:18)</a>:</h4>
<p>i really like <code>where evaluatable { expr }</code> atm</p>



<a name="238325544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325544">(May 11 2021 at 15:18)</a>:</h4>
<p>ok. I agree with that as a core capability, but I definitely think we would also want some way to assert that something is true</p>



<a name="238325561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325561">(May 11 2021 at 15:18)</a>:</h4>
<p><code>evaluatable { .. }</code> feels a bit like compiler jargon to me <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="238325573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325573">(May 11 2021 at 15:18)</a>:</h4>
<p>I don't like evaluatable still</p>



<a name="238325579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325579">(May 11 2021 at 15:18)</a>:</h4>
<p>but</p>



<a name="238325586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325586">(May 11 2021 at 15:18)</a>:</h4>
<p>well, ok, here is the first story</p>



<a name="238325599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325599">(May 11 2021 at 15:19)</a>:</h4>
<blockquote>
<p>Barbara is working on her project. She has the idea to write a <code>split_first</code> function that will allow her to split out the first item from a fixed-length array; naturally, the array must be non-empty. It looks something like this:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">split_first</span><span class="o">&lt;</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">(</span><span class="n">arr</span>: <span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="p">])</span><span class="w"> </span>-&gt; <span class="p">(</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">])</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="c1">// ...</span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">tail</span>: <span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="c1">// ...</span>
<span class="w">    </span><span class="p">(</span><span class="n">head</span><span class="p">,</span><span class="w"> </span><span class="n">tail</span><span class="p">)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>Next she wants to write a function that uses <code>split_first</code>:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">some_method</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">(</span><span class="n">arr</span>: <span class="p">[</span><span class="kt">u8</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="p">])</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="p">(</span><span class="n">first</span><span class="p">,</span><span class="w"> </span><span class="n">rest</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">split_first</span><span class="p">(</span><span class="n">arr</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">rest</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="c1">// ...</span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>The compiler gives her an error message:</p>
<p><div class="codehilite" data-code-language="Bash"><pre><span></span><code>error: the constant expression <span class="sb">`</span>N-1<span class="sb">`</span> is not known to be evaluatable
<span class="m">2</span> <span class="p">|</span>     <span class="nb">let</span> <span class="o">(</span>first, rest<span class="o">)</span> <span class="o">=</span> split_first<span class="o">(</span>arr<span class="o">)</span><span class="p">;</span>
  <span class="p">|</span>                         ^^^^^^^^^^^ <span class="sb">`</span>N-1<span class="sb">`</span> not known to be evaluatable
help: add a where clause to <span class="sb">`</span>some_method<span class="sb">`</span>
  <span class="p">|</span> fn some_method&lt;const N: usize&gt;<span class="o">(</span>arr: <span class="o">[</span>u8<span class="p">;</span> N<span class="o">])</span> where <span class="o">{</span> N - <span class="m">1</span> <span class="o">}</span>
</code></pre></div><br>
</p>
</blockquote>



<a name="238325680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325680">(May 11 2021 at 15:19)</a>:</h4>
<p>I'll use the <code>evaluatable</code> syntax for now</p>



<a name="238325942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325942">(May 11 2021 at 15:21)</a>:</h4>
<p>Why would the error message occur at <code>split_first(arr)</code>? In this implicit model, isn't an implicit bound going to be added to <code>some_method</code> requiring <code>N &gt;= 1</code>?</p>



<a name="238325948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238325948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238325948">(May 11 2021 at 15:21)</a>:</h4>
<p>what ppl actually want to express here is "N &gt; 0"</p>



<a name="238326013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326013">(May 11 2021 at 15:21)</a>:</h4>
<p>hold on, story is incomplete</p>



<a name="238326030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326030">(May 11 2021 at 15:21)</a>:</h4>
<p>yes, <span class="user-mention" data-user-id="124288">@oli</span>, I added that as variant B</p>



<a name="238326062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326062">(May 11 2021 at 15:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="121053">varkor</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238325942">said</a>:</p>
<blockquote>
<p>Why would the error message occur at <code>split_first(arr)</code>? In this implicit model, isn't an implicit bound going to be added to <code>some_method</code> requiring <code>N &gt;= 1</code>?</p>
</blockquote>
<p>nope</p>



<a name="238326082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326082">(May 11 2021 at 15:21)</a>:</h4>
<p>I was assuming the same implied bounds we have today</p>



<a name="238326104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326104">(May 11 2021 at 15:21)</a>:</h4>
<p>which means that the functions get to assume their argument types + return types are well-formed</p>



<a name="238326159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326159">(May 11 2021 at 15:22)</a>:</h4>
<p>and we can assume that a constant expression is only well-formed if it is evaluatable</p>



<a name="238326169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326169">(May 11 2021 at 15:22)</a>:</h4>
<p>does that make sense?</p>



<a name="238326210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326210">(May 11 2021 at 15:22)</a>:</h4>
<p>(I'll add a few "notes" on the implications in the hackmd)</p>



<a name="238326221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326221">(May 11 2021 at 15:22)</a>:</h4>
<p>we are going to want to break this out into a repo soon though</p>



<a name="238326240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326240">(May 11 2021 at 15:22)</a>:</h4>
<p>Right, so <code>N - 1</code> is assumed well-formed for <code>split_first</code> because it appears in the return type.</p>



<a name="238326269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326269">(May 11 2021 at 15:22)</a>:</h4>
<p>right, whcih we do today for region relationships (somewhat unsoundly, but never mind, we'll fix that)</p>



<a name="238326308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326308">(May 11 2021 at 15:23)</a>:</h4>
<p>But we couldn't write <code>N - 2</code> inside <code>split_first</code>.</p>



<a name="238326321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238326321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238326321">(May 11 2021 at 15:23)</a>:</h4>
<p>correct</p>



<a name="238327488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238327488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238327488">(May 11 2021 at 15:30)</a>:</h4>
<p>ok, the hackmd is I think telling the best version of 3 stories :)</p>



<a name="238327514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238327514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238327514">(May 11 2021 at 15:30)</a>:</h4>
<p>with some unknowns in how we could achieve it...</p>



<a name="238327634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238327634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238327634">(May 11 2021 at 15:30)</a>:</h4>
<p>I really like the idea of being able to write <code>where { N &gt; 0 }</code> to satisfy <code>N - 1</code> being evaluatable <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="238327694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238327694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238327694">(May 11 2021 at 15:31)</a>:</h4>
<p>I feel like we'd be doing our users a disservice not to try and get there, even if we don't start there</p>



<a name="238327823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238327823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238327823">(May 11 2021 at 15:31)</a>:</h4>
<p>there' a lot of work going on to create formal verifiers and things for Rust</p>



<a name="238327842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238327842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238327842">(May 11 2021 at 15:32)</a>:</h4>
<p>we talked about this early in the design phase and kind of bailed out with "where would we stop, we don't know, so let's stop thinking about it for now". But yea, we should have a plan</p>



<a name="238327927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238327927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238327927">(May 11 2021 at 15:32)</a>:</h4>
<p>right</p>



<a name="238328076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238328076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238328076">(May 11 2021 at 15:33)</a>:</h4>
<p>I'm not sure how consistent the final version of this story is, the one with monomorphization errors</p>



<a name="238328158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238328158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238328158">(May 11 2021 at 15:33)</a>:</h4>
<p>i think we won't error in <code>some_method</code>, will we?</p>



<a name="238328563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238328563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238328563">(May 11 2021 at 15:34)</a>:</h4>
<p>yea, the root error span should be in user code</p>



<a name="238328603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238328603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238328603">(May 11 2021 at 15:35)</a>:</h4>
<p>I think I expect the error to occur in <code>split_first</code>, which is what I wrote</p>



<a name="238328690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238328690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238328690">(May 11 2021 at 15:35)</a>:</h4>
<p>at <em>some</em> point we are going to try and evaluate <code>N-1</code> and we're going to get an error</p>



<a name="238328996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238328996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238328996">(May 11 2021 at 15:36)</a>:</h4>
<p>but, tbh, for CTFE we also report the root span at the actual error site and just print a backtrace that points back to user code</p>



<a name="238329113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329113">(May 11 2021 at 15:36)</a>:</h4>
<p>it sometimes gives subpar diagnostics</p>



<a name="238329355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329355">(May 11 2021 at 15:37)</a>:</h4>
<p>example: <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=2fe4ec2caf822f8ce51c0517dbe93450">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=2fe4ec2caf822f8ce51c0517dbe93450</a></p>



<a name="238329430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329430">(May 11 2021 at 15:38)</a>:</h4>
<p>Probably the diagnostics are going to be subpar either way in some cases, e.g. deeply nested code, because you either have no idea why the function you're calling doesn't like its inputs, or you're looking at some code you have no familiarity with because it's not your own code.</p>



<a name="238329486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329486">(May 11 2021 at 15:38)</a>:</h4>
<p>well, I'm kind of trying to imagine what diagnostics i would want</p>



<a name="238329531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329531">(May 11 2021 at 15:38)</a>:</h4>
<p>but even in this example</p>



<a name="238329537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329537">(May 11 2021 at 15:38)</a>:</h4>
<p>it's not hard to imagine that it's confusing</p>



<a name="238329647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329647">(May 11 2021 at 15:39)</a>:</h4>
<p>we could easily rewrite the story to be that she has written the top function (not shown) which calls <code>some_method</code> and gets this error</p>



<a name="238329673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329673">(May 11 2021 at 15:39)</a>:</h4>
<p>and she has to dive in a bit and understand what is going on</p>



<a name="238329726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329726">(May 11 2021 at 15:39)</a>:</h4>
<p>that said</p>



<a name="238329817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329817">(May 11 2021 at 15:40)</a>:</h4>
<p>I think what concerns me is that we're going to wind up with a blizzard of "similar but different" evaluatable things</p>



<a name="238329918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329918">(May 11 2021 at 15:40)</a>:</h4>
<p>or exposing way more details than we would want to about the contents of the function body</p>



<a name="238329974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329974">(May 11 2021 at 15:40)</a>:</h4>
<p>I think that of these stories, to me, the Version B is the one to go for (<code>where N &gt; 0</code>)</p>



<a name="238329990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238329990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238329990">(May 11 2021 at 15:40)</a>:</h4>
<p><span class="user-mention" data-user-id="326176">@Boxy [she/her]</span> did suggest a solution here <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235389010">https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235389010</a></p>



<a name="238330008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330008">(May 11 2021 at 15:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238329990">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="326176">Boxy [she/her]</span> did suggest a solution here <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235389010">https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235389010</a></p>
</blockquote>
<p>oh god did I</p>



<a name="238330010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330010">(May 11 2021 at 15:40)</a>:</h4>
<p>which uses version A</p>



<a name="238330035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330035">(May 11 2021 at 15:41)</a>:</h4>
<p>and can <em>assume</em> some bounds to hold</p>



<a name="238330041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330041">(May 11 2021 at 15:41)</a>:</h4>
<p>so e.g.</p>



<a name="238330081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330081">(May 11 2021 at 15:41)</a>:</h4>
<p>I don't know that I see the advantage to that</p>



<a name="238330100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330100">(May 11 2021 at 15:41)</a>:</h4>
<p>you still have to type out all the things, right/</p>



<a name="238330127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330127">(May 11 2021 at 15:41)</a>:</h4>
<p>I think that is mainly bubbling vs not bubbling the bound</p>



<a name="238330134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330134">(May 11 2021 at 15:41)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">some_method</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">(</span><span class="n">arr</span>: <span class="p">[</span><span class="kt">u8</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="p">])</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="p">(</span><span class="n">first</span><span class="p">,</span><span class="w"> </span><span class="n">rest</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">split_first</span><span class="p">(</span><span class="n">arr</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="p">(</span><span class="n">second</span><span class="p">,</span><span class="w"> </span><span class="n">rest</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">split_first</span><span class="p">(</span><span class="n">rest</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">rest</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="c1">// ...</span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="238330136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330136">(May 11 2021 at 15:41)</a>:</h4>
<p>yeah, ok</p>



<a name="238330167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330167">(May 11 2021 at 15:41)</a>:</h4>
<p>you take some risk on yourself somehow</p>



<a name="238330323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330323">(May 11 2021 at 15:42)</a>:</h4>
<p>"unsafe where { N - 1 }" <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="238330325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330325">(May 11 2021 at 15:42)</a>:</h4>
<p>can now you can use <code>assume { N -  1 }</code>, <code>evaluatable { N - 2 }</code> in <code>some_method</code> and only require <code>evaluatable { N - 2 }</code> when using <code>some_method</code></p>



<a name="238330392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330392">(May 11 2021 at 15:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238330100">said</a>:</p>
<blockquote>
<p>you still have to type out all the things, right/</p>
</blockquote>
<p>i guess that still can happen even with version B</p>



<a name="238330462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330462">(May 11 2021 at 15:43)</a>:</h4>
<p>that's a better example</p>



<a name="238330472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330472">(May 11 2021 at 15:43)</a>:</h4>
<p>the two calls to <code>split_first</code></p>



<a name="238330513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330513">(May 11 2021 at 15:43)</a>:</h4>
<p>ok, let's add that as Version D for now I guess</p>



<a name="238330525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330525">(May 11 2021 at 15:43)</a>:</h4>
<p>my concern with version B is that figuring out these bounds is generally impossible</p>



<a name="238330609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330609">(May 11 2021 at 15:44)</a>:</h4>
<p>so there will be a point where this breaks down and the user has to write unnecessary bounds</p>



<a name="238330662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330662">(May 11 2021 at 15:44)</a>:</h4>
<p>yes. It'd be good to have some examples where we see that happening. it feels like it kind of "bottoms out" to version a</p>



<a name="238330681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330681">(May 11 2021 at 15:44)</a>:</h4>
<p>like, in the worst case, it looks like version A</p>



<a name="238330758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330758">(May 11 2021 at 15:45)</a>:</h4>
<p>I'm trying to thikn about other forms of const evaluation errors we might encounter</p>



<a name="238330798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330798">(May 11 2021 at 15:45)</a>:</h4>
<p>index out of bounds?</p>



<a name="238330860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330860">(May 11 2021 at 15:45)</a>:</h4>
<p>unsafe code-- casting fn to integer and then manipulating it</p>



<a name="238330910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330910">(May 11 2021 at 15:45)</a>:</h4>
<p>unsafe code: accessing undefined bits</p>



<a name="238330917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330917">(May 11 2021 at 15:45)</a>:</h4>
<p>there are some programs which only work for arrays of prime length or something, so these would need boolean bounds</p>



<a name="238330923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238330923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238330923">(May 11 2021 at 15:46)</a>:</h4>
<p>those are both cases where you can't readily create a boolean expression to represent them</p>



<a name="238331069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331069">(May 11 2021 at 15:46)</a>:</h4>
<p>(array length is <em>plausible</em>)</p>



<a name="238331177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331177">(May 11 2021 at 15:47)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238330917">said</a>:</p>
<blockquote>
<p>there are some programs which only work for arrays of prime length or something, so these would need boolean bounds</p>
</blockquote>
<p>As in there exist such programs in theory, or people are actually writing them?</p>



<a name="238331207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331207">(May 11 2021 at 15:47)</a>:</h4>
<p>people are actually writing them</p>



<a name="238331240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331240">(May 11 2021 at 15:47)</a>:</h4>
<p>iirc some hashing algorithms work that way</p>



<a name="238331241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331241">(May 11 2021 at 15:47)</a>:</h4>
<p>For cryptography?</p>



<a name="238331313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331313">(May 11 2021 at 15:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="121053">varkor</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238331241">said</a>:</p>
<blockquote>
<p>For cryptography?</p>
</blockquote>
<p>that too probably</p>



<a name="238331366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331366">(May 11 2021 at 15:48)</a>:</h4>
<p>yea, I can confirm interesting compile-time math for array lengths in cryptography</p>



<a name="238331400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331400">(May 11 2021 at 15:48)</a>:</h4>
<p>oh I would LOVE to see some cryptography examples</p>



<a name="238331436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331436">(May 11 2021 at 15:48)</a>:</h4>
<p>I wanted to add some more realistic and engaging examples</p>



<a name="238331500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331500">(May 11 2021 at 15:48)</a>:</h4>
<p>I don't have a very clear picture on why generics are so useful</p>



<a name="238331568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331568">(May 11 2021 at 15:49)</a>:</h4>
<p>I'll ask, maybe we'll have examples for next week</p>



<a name="238331579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331579">(May 11 2021 at 15:49)</a>:</h4>
<p>(I guess to customize like...number of bits in the hash...?)</p>



<a name="238331618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331618">(May 11 2021 at 15:49)</a>:</h4>
<p>ok :) i'm curious who you would ask</p>



<a name="238331971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238331971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238331971">(May 11 2021 at 15:51)</a>:</h4>
<p>my previous employer</p>



<a name="238332067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238332067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238332067">(May 11 2021 at 15:52)</a>:</h4>
<p>there was a really complex use of the typenum crate with crazy math bounds to ensure that the crypto ops could only be used correctly</p>



<a name="238332268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238332268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238332268">(May 11 2021 at 15:53)</a>:</h4>
<p>ok</p>



<a name="238337050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238337050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238337050">(May 11 2021 at 16:21)</a>:</h4>
<p>what's the desired "end goal" for this vision doc- for example should we have stuff in there about opt-in-ness of types being const paramable so that library authors cant accidentally break peoples code by adding a pointer to their struct?</p>



<a name="238632342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238632342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238632342">(May 13 2021 at 14:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238322228">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-05-11/near/238321956">said</a>:</p>
<blockquote>
<p>but i want <span class="user-mention silent" data-user-id="120791">RalfJ</span> to be there whenever we talk about that</p>
</blockquote>
<p>I think a better approach than expecting everyone to be present is to get feedback from them</p>
</blockquote>
<p>I'm happy to comment asynchronously on things; synchronous time is a lot harder to find. :D</p>



<a name="238632387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238632387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238632387">(May 13 2021 at 14:55)</a>:</h4>
<p>we also have some notes at <a href="https://github.com/rust-lang/const-eval/blob/master/const_safety.md">https://github.com/rust-lang/const-eval/blob/master/const_safety.md</a> that might be a good starting point</p>



<a name="238685539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-05-11/near/238685539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-05-11.html#238685539">(May 13 2021 at 21:42)</a>:</h4>
<p>thanks <span class="user-mention" data-user-id="120791">@RalfJ</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>